home *** CD-ROM | disk | FTP | other *** search
Makefile | 2000-05-30 | 1.7 KB | 80 lines |
- ################################################
- # ALGOMATH makefile release 1.0.5 03.2000#
- ################################################
-
- # replace this definition if you are using PGCC or EGCS(pentium)
- #PGCC = 1
- #EGCS = 1
-
- # disable this definition if you dont include the
- # assembly function isprime(): #ASSEMBLY = 1
- ASSEMBLY = 1
-
- VPATH = src obj
-
- TEST = test
- OBJ = obj
- SRC = src
- AR = ar
- CC = gcc
-
- ifdef WARNMODE
- WFLAGS = -Wall -W -Werror -Wno-sign-compare
- else
- WFLAGS = -Wall -Wno-sign-compare
- endif
-
- ifdef EGCS
- OFLAGS = -march=pentium -mpentium -O3 -fomit-frame-pointer
- else
- OFLAGS = -O3 -fomit-frame-pointer
- endif
- ifdef PGCC
- OFLAGS = -mpentium -O6 -fomit-frame-pointer
- endif
-
- CFLAGS = -I. -Isrc -I$(OBJ) -I$(TEST) $(WFLAGS) $(OFLAGS)
-
- LIBALGO = lib/libalgo.a
- DEFS=defs.h
-
- ifdef ASSEMBLY
- ASSOBJ = assembly/obj/isprime.o
- endif
-
- OBJS = fact.o gcd.o goldbach.o init.o exit.o isprime.o \
- rotatex.o sdigalt.o sortdig.o sumdigit.o numlen.o sumdiv.o \
- swapdig.o extdigx.o repdig.o priarray.o priarrab.o primeab.o \
- hail.o
-
- LIB_OBJS = $(addprefix $(OBJ)/,$(OBJS))
-
- .PRECIOUS: $(OBJ)/%.o
- .PHONY: all lib test msg2 clean
-
- all: lib msg2
-
- lib: $(LIBALGO)
-
- $(OBJ)/%.o: src/%.c
- $(CC) $(CFLAGS) -c $^ -o $@
-
- $(LIBALGO): $(LIB_OBJS) $(ASSOBJ)
- $(AR) rvs $(LIBALGO) $(LIB_OBJS) $(ASSOBJ)
-
- msg2:
- @echo
- @echo ############################################################
- @echo All done.
- @echo copy from lib/libalgo.a to your library path
- @echo copy algomath.h to your include path
- @echo To use Algomath, #include algomath.h and link with libalgo.a
- @echo Example command line: gcc foobar.c -o foobar.exe -lalgo
- @echo ############################################################
-
- clean:
- -rm -v $(LIB_OBJS)
-
- #$(addprefix $(OBJ)/, $(OBJS)): $(DEPS)
-
-